﻿/**
 * 
 * @file FITKAcousticsFEModel.h
 * @brief FE模型
 * @author LiBaojun (libaojunqd@foxmail.com)
 * @date 2024-10-06
 * 
 */
#ifndef _FITKACOUSTICS_FEMODEL_H___
#define _FITKACOUSTICS_FEMODEL_H___
 
#include "FITKAcousticsModelAPI.h"
#include "FITK_Component/FITKAbaqusData/FITKDataCase.h"
#include "FITK_Interface/FITKInterfaceModel/FITKElementList.h"

namespace Acoustics
{
    class FITKAbstractFESubSys;
    class FITKAcousticsFESubSysElementList;
    class FITKAcousticsFENodeMapManager;
    class FITKAcousticsFESubSysManager;
    class FITKAcousticsFEFaceManager;
    class FITKAcousticsSensorsManager;
    /**
     * @brief FE模型声明，Abaqus类型
     * @author LiBaojun (libaojunqd@foxmail.com)
     * @date 2024-10-06
     */
    class FITKAcousticsModelAPI FITKAcousticsFEModel : 
        public AbaqusData::FITKDataCase
    {
        FITKCLASS(Acoustics, FITKAcousticsFEModel);
    public:
        /**
         * @brief Construct a new FITKAcousticsFEModel object
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-06
         */
        explicit FITKAcousticsFEModel();
        /**
         * @brief Destroy the FITKAcousticsFEModel object
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-06
         */
        virtual ~FITKAcousticsFEModel();
        /**
         * @brief    获取单元列表
         * @return   FITKAcousticsFESubSysElementList *
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-12-18
         */
        FITKAcousticsFESubSysElementList* getFESubSysElementList();
        /**
         * @brief    获取FE子系统管理器
         * @return   FITKAcousticsFESubSysManager *
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-12-18
         */
        FITKAcousticsFESubSysManager* getFESubSysManager();
        /**
         * @brief    获取FE面管理器
         * @return   FITKAcousticsFEFaceManager *
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-12-18
         */
        FITKAcousticsFEFaceManager* getFEFaceManager();
        /**
         * @brief    获取传感器管理器
         * @return   FITKAcousticsSensorsManager *
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-12-18
         */
        FITKAcousticsSensorsManager* getSensorManager();
        /**
         * @brief    获取节点映射管理器
         * @return   FITKAcousticsFENodeMapManager *
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-11-18
         */
        FITKAcousticsFENodeMapManager* getNodesMapManager();
        /**
         * @brief 获取与节点关联的子系统
         * @param[i] nodeIDs  输入节点列表
         * @param[i] common 求节点关联子系统的交集或者并集  true-输出交集  false-输出并集
         * @return QList<FITKAbstractFESubSys*>
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-11-14
         */
        QList<FITKAbstractFESubSys*> getFESubsysConnectedWithNodes(const QList<int>& nodeIDs, const bool& common = false) const;
        /**
         * @brief    清理FE子系统模型
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-11-21
         */
        void clearFEModel();

    private:
        /**
         * @brief  单元列表
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2024-12-18
         */
        FITKAcousticsFESubSysElementList* _elementList{};
        /**
         * @brief  子系统管理器
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2024-12-18
         */
        FITKAcousticsFESubSysManager* _subSysManager{};
        /**
         * @brief  面管理器
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2024-12-18
         */
        FITKAcousticsFEFaceManager* _faceManager{};
        /**
         * @brief  传感器管理器
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2024-12-18
         */
        FITKAcousticsSensorsManager* _sensorManager{};
        /**
         * @brief  节点映射管理器
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2024-11-18
         */
        FITKAcousticsFENodeMapManager* _nodesMapManager{};
    };
    /**
     * @brief  FE子系统单元列表
     * @author liuzhonghua (liuzhonghuaszch@163.com)
     * @date   2024-12-18
     */
    class FITKAcousticsModelAPI FITKAcousticsFESubSysElementList : public Interface::FITKElementList
    {
    public:
        /**
         * @brief Construct a new FITKAcousticsFESubSysElementList object
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2024-12-18
         */
        explicit FITKAcousticsFESubSysElementList() = default;
        /**
         * @brief Destroy the FITKAcousticsFESubSysElementList object
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2024-12-18
         */
        virtual ~FITKAcousticsFESubSysElementList() = default;
        /**
         * @brief    设置单元属性
         * @param[i] elemID 单元ID
         * @param[i] propID 属性ID
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-01-02
         */
        void setElementPropID(int elemID, int propID);
        /**
         * @brief    获取单元属性ID
         * @param[i] elemID 单元ID
         * @param[o] isFEProperty 是否是FE属性
         * @return   int 属性ID
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-01-02
         */
        int getElementPropID(int elemID, bool* isFEProperty = nullptr);
        /**
         * @brief    获取单元属性名称
         * @param[i] elemID 
         * @return   QString
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-01-02
         */
        QString getElementPropName(int elemID);

    private:
        /**
         * @brief  单元属性映射表< elemID, propID >
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2025-01-02
         */
        QHash<int, int> _elementPropHash{};
    };
}


#endif
